import * as types from '../actionTypes'

// 状态
const state = {
  loading: false,
  isLogin: false,
  username: '这里是名字'
}

// 回写
const mutations = {
  [types.CHANGE_LOADING] (state, loading) {
    state.loading = loading
  }
}

// 衍生属性
const getters = {
	// coolMan: state => state.username + " cool"
}

// 事件
const actions = {
	changeLoading ({ commit, state }, loading) {
		commit(types.CHANGE_LOADING, loading)
	}
}

export default {
  state,
  mutations,
  getters,
  actions
}